package loja.view.editor.components.tablemodel;

import java.util.ArrayList;
import java.util.List;

import javax.swing.table.AbstractTableModel;

public abstract class EntityTableModel<T> extends AbstractTableModel {

	private static final long serialVersionUID = 1L;

	protected List<T> entities = new ArrayList<>();
	protected List<String> columns;

	@Override
	public String getColumnName(int column) {
		return columns.get(column);
	}

	@Override
	public int getColumnCount() {
		return columns.size();
	}

	@Override
	public int getRowCount() {
		return entities.size();
	}

	public List<T> getEntities() {
		return entities;
	}

	public void setEntities(List<T> entities) {
		this.entities = entities;
	}
}
